﻿using System;

namespace YArchitech.Revit.MEP.Calculator
{
	public class BuildingPlaceData
	{
		public BuildingPlaceData()
		{
			this.State = DataState.Ready;
			this.Id = -1;
			this.Industry = string.Empty;
			this.BuildingType = string.Empty;
			this.Place = string.Empty;
			this.RefPlane = string.Empty;
			this.NowPD = string.Empty;
			this.TargetPD = string.Empty;
			this.IllStandard = 0;
			this.GlareValue = string.Empty;
			this.IllEvenness = string.Empty;
			this.Ra = 0;
		}

		public DataState State { get; set; }

		public int Id { get; set; }

		public string Industry { get; set; }

		public string BuildingType { get; set; }

		public string Place { get; set; }

		public string RefPlane { get; set; }

		public string NowPD { get; set; }

		public string TargetPD { get; set; }

		public int IllStandard { get; set; }

		public string GlareValue { get; set; }

		public string IllEvenness { get; set; }

		public int Ra { get; set; }

		public object this[string fieldName]
		{
			get
			{
				if ("Place" == fieldName)
				{
					return this.Place;
				}
				if ("RefPlane" == fieldName)
				{
					return this.RefPlane;
				}
				if ("NowPD" == fieldName)
				{
					return this.NowPD;
				}
				if ("TargetPD" == fieldName)
				{
					return this.TargetPD;
				}
				if ("IllStandard" == fieldName)
				{
					return this.IllStandard;
				}
				if ("GlareValue" == fieldName)
				{
					return this.GlareValue;
				}
				if ("IllEvenness" == fieldName)
				{
					return this.IllEvenness;
				}
				if ("Ra" == fieldName)
				{
					return this.Ra;
				}
				return null;
			}
			set
			{
				if ("Place" == fieldName)
				{
					this.Place = value.ToString();
				}
				if ("RefPlane" == fieldName)
				{
					this.RefPlane = value.ToString();
				}
				if ("NowPD" == fieldName)
				{
					this.NowPD = value.ToString();
				}
				if ("TargetPD" == fieldName)
				{
					this.TargetPD = value.ToString();
				}
				if ("IllStandard" == fieldName)
				{
					this.IllStandard = Convert.ToInt32(value);
				}
				if ("GlareValue" == fieldName)
				{
					this.GlareValue = value.ToString();
				}
				if ("IllEvenness" == fieldName)
				{
					this.IllEvenness = value.ToString();
				}
				if ("Ra" == fieldName)
				{
					this.Ra = Convert.ToInt32(value);
				}
			}
		}
	}
}
